﻿#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
using namespace std;
int main()
{
	//string str1;
	//cout << str1 << endl;
	//string str2("i love you");//直接传入字符串构造
	//cout << str2[0] << endl;
	//string str3(str2.begin(), str2.end());//利用迭代器去构造
	//cout << str3;
	//string str2("i love you");
	//string str3(str2);//拷贝构造
	//cout << str3;
	
	//cout << str1.size() << endl;//返回有效字符个数
	//cout << str1.length() << endl;
	//string str1("1024");
	//str1 = "";
	//if (str1.empty())
	//	cout << "有效字符个数为零"<<endl;
	//cout << str1.capacity();//返回字符串目前所占的空间； 
	////string str2;
	////if (str2.empty())
	////	cout << "po";
	//string s;
	//cout << s.capacity() << endl;
	//s.reserve(20);//告诉扩容函数我要放20个字符，你的不够用了，就快点扩容
	//cout << s.capacity() << endl;
	//string s;
	//s.resize(10);//将有效字符的个数该成10个，多出的空间用字符'\0'填充
	//cout << s << endl;
	//s.resize(20, 'a');//将有效字符的个数该成20个，多出的空间用字符'a'填充
	//cout << s<<endl;
	////s.clear();//清空有效字符
	////cout << s.size();
	//string s("hello 1024");
	/*for (int i = 0; i < s.size(); i++)
	{
		cout << s[i];
	}*/
	//string::iterator it = s.begin();//这里要指定谁的迭代器
	//while (it != s.end())
	//{
	//	cout << *it;
	//	it++;
	//}
	/*string::reverse_iterator it = s.rbegin();
	while (it != s.rend())
	{
		cout << *it;
	//	it++;
	//}*/
	//string::reverse_iterator it = s.rend()-1;
	//while (it != s.rbegin()+1)
	//{
	//	cout << *it;
	//	it--;
	//}
	//s.push_back('a');//在结尾添加字符'a'
	//cout << s;
	//string s("hello");
	//s.append(" 1024");
	//cout << s << endl;
	//string s("hello ");
	//s += "1024";
	//cout << s<<endl;
	////string::iterator it=s.insert(s.end(), 'a');
	//cout << s << endl;
	//s.pop_back();
	//cout << s << endl;
	//s.erase(0, 5);//从0位置开始删5个字符
	//cout << s << endl;
	//string s("abbba");
	//size_t a=s.find("bb", 2);//从2位置开始向后找
	//cout << a << endl;
	//size_t b=s.find('a');//用缺省参数，即从0位置开始向后找
	//cout << b<<endl;
	//size_t c = s.find('a',3);
	//cout << c;
	//string s("abbba");
	//size_t b=s.rfind('a');//默认从最后一个位置向前找
	//cout << b << endl;
	//size_t c = s.rfind('a',2);//从2位置向前找
	//cout << c << endl;
	//string s("hello");
	////const char* a = s.c_str();
	////cout << a;
	//string a = s.substr(2, 3);//从2位置开始拷贝3个字符，组成字符串返回
	//cout << a<<endl;
	//cout << s;
	string s;
	getline(cin, s);
	cout << s << endl;
}